#pragma once

namespace nef {

/*
 * 
 */
class IPartImportsSatisfied
{
public:
	virtual ~IPartImportsSatisfied() {}

	virtual void OnImportsSatisfied() = 0;
};

template<typename T, bool v>
struct class_imports_satisfied_t
{
	static void Invoke(T &val)
	{
		// This type doesn't inherit from IPartImportsSatisfied
	}
};

template<typename T>
struct class_imports_satisfied_t<T, true>
{
	static void Invoke(T &val)
	{
		val.OnImportsSatisfied();
	}
};

template<typename T>
void CallImportsSatisfied(T &val)
{
	static const bool IS_IX = std::is_base_of<IPartImportsSatisfied, T>::value;

	class_imports_satisfied_t<T, IS_IX>::Invoke(val);
}

}